<template>
	<view class="p20">
		<view class=" bg-fff radius20 pl20 pr20">
			<u-form label-width="auto" inputAlign="right">
				<u-form-item label="开户人姓名">
					<u-input v-model="form.name" placeholder="请输入开户人姓名" />
				</u-form-item>
				<u-form-item label="银行名称">
					<u-input v-model="form.bank_name" placeholder="请输入银行名称" />
				</u-form-item>
				<u-form-item label="银行卡号">
					<u-input v-model="form.card_no" placeholder="请输入银行卡号" />
				</u-form-item>
			</u-form>
		</view>
		<view class="h120"></view>
		<view class="pf bottom0 left0 bg-fff w-max">
			<view class="flex">
				<view class="flex1 p20">
					<u-button type="warning" ripple @click="submit">提交</u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					name: "", //开户人姓名
					bank_name: "", //银行名称
					card_no: '', //银行卡号
				},
			};
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData() {
				this.$request('/master/money/bankInfo', this.$params).then(res => {
					this.data = res.data
					for (let key in this.form) {
						this.form[key] = res.data[key] || this.form[key]
					}
				})
			},
			submit() {
				this.$request('/master/money/bindBank', this.form).then(res => {
					this.$msg(res.msg)
					this.$getUser()
					this.$navBack(1, 1000)
				})
			},
		}
	}
</script>

<style lang="scss">

</style>